<? 
require_once '../includes/includes.php';
include ("seguridad.php");
conexion();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulopanel(); ?></title>
<link rel="STYLESHEET" type="text/css" href="estilo.css">
<!-- Editor TinyMce -->
<script type="text/javascript" src="../plugins/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<!-- Tinymce -->
<?php include_once 'includes/tinymce.html';?>


</head>

<body>


<div id="contenedor">

  	<div id="encabezado"><?php include('header.php') ?></div><!--fin de encabezado-->



	<div id="menuizquierda"><?php include('menu.php') ?></div>	<!--fin de menuizquierda-->

	<div id="content">


	<div id="formulario">

			<br>
			<?php


if(isset($_GET['var'])){
			
			$var=sqlint($_GET['var']);
			$result=mysql_query("select * from news where id=$var");

if(mysql_num_rows($result) !=0){
			while($row=mysql_fetch_array($result))
			{

			$impresos++; //me va aumentando por cada uno asi despues puedo usar para la PAGINACION

			$id_news=$row['id'];
			$title=cleanxss($row['title']);
			$summary=$row['summary'];
			$content=$row['content'];
			$categorie=$row['category_id'];
			$published=$row['is_published'];
			
			
			$rowcategorie=existe("id", "categories", $categorie);//GET DESCTIPTION CATEGORY
			

			}

			mysql_free_result($result);

}
else {
	$_SESSION["errorborrarnoticia"]="noexiste";
	header	("location: noticias.php");
}

			
?>
		

	
<span class="title">Eliminar Noticia</span>		
			<br>
			<br>
			
			<form class="admin" action="control_noticias.php" method="post">
				<fieldset class="admin">
				<legend>Noticia</legend>
							
				<p><span>Publicar:</span>
				
				<?php 
				if($published==1){
					echo '<input type="checkbox" name="published" value="1" checked /></input>';
					 
					}else{
						
					echo '<input type="checkbox" name="published" value="1" /></input>';		
					}
				
				
				?>
				</p>
				
				<br>
				<p><span>Categoria:</span>
				
				<select name="categorie">
				<option value ='<?php $categorie?>'><?php echo $rowcategorie['description']?></option> 
				
				</select></p>
				<br>
				<p><span>
				T&iacute;tulo:</span>
				<input type="text" name="title" id="title" onkeyup="if (this.value.length == 139) this.disabled = true;" size="70px" value="<?php echo $title?>">
				<br></p>
				<p><span>
				Copete:</span>
				<textarea name="summary" cols="60" rows="3"><?php echo $summary?></textarea></p>
				<br><br><br><br><br><br><br><br>
				<p><span>Cuerpo:</span>
				<textarea name="conten" cols="60" rows="25"><?php echo $content?></textarea>
				<input name="boton" type="hidden" id="boton" value="3"></input>
				<input name="id_news" type="hidden" id="boton" value="<?php echo $id_news?>"></input>
				<br>
				</p>
				</fieldset>
				<br>
				<input type="submit" class="buttonadmin" value="Borrar">
				<a class="enlacecancelar" href="noticias.php"><input type="button" class="buttoncancelar" value="Cancelar"></a>
				
				
			</form>
			<br>
			<br>


<?php 
} #Cierra el IF del isset($_GET['var'])

?>


		</div><!-- formulario -->

		</div><!--content-->


<div id="piepagina">

</div>
<!--fin de piepagina-->

</div><!-- contenedor -->


</body>

</html>
